﻿<Page x:Class="SGT.Views.PortadaView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:DV="clr-namespace:System.Windows.Controls.DataVisualization;assembly=System.Windows.Controls.DataVisualization.Toolkit"
        xmlns:DVC="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
       xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing"
       xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      
      xmlns:System_Windows_Controls_DataVisualization_Charting_Primitives="clr-namespace:System.Windows.Controls.DataVisualization.Charting.Primitives;assembly=System.Windows.Controls.DataVisualization.Toolkit" mc:Ignorable="d"
       
      d:DesignHeight="420" d:DesignWidth="721" >

    <Page.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Skins/MainSkin.xaml" />
            </ResourceDictionary.MergedDictionaries>
            <DataTemplate x:Key="DataTemplate1">
                <DVC:Chart Title="{Binding Titulo}" Canvas.Top="10" />

            </DataTemplate>
        </ResourceDictionary>
    </Page.Resources>

    <Page.DataContext>
        <Binding Path="Portada" Source="{StaticResource Locator}"/>
    </Page.DataContext>




    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="100*" />
            <RowDefinition Height="267*" />
        </Grid.RowDefinitions>
        <ListBox ItemsSource="{Binding Charts}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Hidden" SelectedItem="{Binding GraficaSelcionada}" ItemContainerStyle="{DynamicResource EstiloDeFoco}" BorderBrush="{x:Null}">
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <UniformGrid Rows="1"  Width="auto" Height="auto" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
            <ListBox.ItemTemplate>

                <DataTemplate>
                    <DVC:Chart Title="{Binding Titulo}" Width="Auto" Height="auto" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" LegendStyle="{StaticResource LegendStyle}" >

                        <DVC:ColumnSeries  DependentValueBinding="{Binding UsoActual}" IndependentValueBinding="{Binding TipoMercaderia.Nombre}" ItemsSource="{Binding ListaSectores}" Width="auto"
                                               
                                               >
                            <DVC:ColumnSeries.Effect>
                                <DropShadowEffect/>
                            </DVC:ColumnSeries.Effect>
                            <DVC:ColumnSeries.DependentRangeAxis>
                                <DVC:LinearAxis 
                        Orientation="Y"
                        Minimum="0"
                        Maximum="{Binding MaxRango}"
                        ShowGridLines="True" DataContext="{Binding ListaSectores}" MajorTickMarkStyle="{Binding}" />
                            </DVC:ColumnSeries.DependentRangeAxis>

                        </DVC:ColumnSeries>

                    </DVC:Chart>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </Grid>
</Page>
